from django.contrib import admin
from django.urls import path, re_path, include
from django.conf.urls import url
from . import views
from rest_framework import routers

router = routers.DefaultRouter()
router.register(r'areas', views.AreaViewSet, basename='area')       # 如果视图集中，没有给queryset类属性指定查询集，就必须给basename传参数，如果不传默认取queryset中指定的查询集模型名小写作为路由别命前缀


urlpatterns = [
    # 查询所有省
    # re_path(r'^areas/$', views.AreaListView.as_view()),
    # re_path(r'^areas/(?P<pk>\d+)/$', views.AreaDetalView.as_view()),
    re_path(r'^',include(router.urls)),

]